<template lang="pug">
  .container.homework__main
    .row
      .col-sm-3
        h2.side__menu__title 课本
          .side__menu__switch.side__menu__switch_teacher(@click.stop="selectBook")
            i.icon_switch_normal
            | 切换
          .side__menu__switch.side__menu__switch_teacher.add(@click.stop="addBook")
            i.icon_switch_normal
            | 添加
        h3.side__menu__dt 高二课本 (第二学期)
        ul.side__menu__list
          li
            a(href="") 第11章   坐标平面有理数函数
            ul
              li
                a(href="") 二次函数
              li
                a(href="") 不等式方式
                ul
                  li
                    a(href="") 坐标平面有理数函数
      .col-sm-9
        .track-content
          .track-head
            .track-select
              //.class-select 高一一班
              select.class-select
                option 高一一班
                option 高一二班
                option 高一三班
              .submit-select
                .select
                  span.select-border.un-select
                  span.un-sumit.un-title 未交
                .select
                  span.select-border.select
                  span.sumit.title 已交
                .totol-count 共36人
                .every-anlysis 逐题分析            
            .track-select-student-name
              span.student-name(v-for="item in studentNameList") {{ item.name }}
          .track-body
            table.track-table.homework__tb
              tr
                td 姓名
                td 学号
                td 得分
                td 名次
                td 学习次数
                td 学习时段
                td 操作
              tr(v-for="item in list")
                td {{item.homeworkName}}
                td {{item.homeworkStatus}}
                td {{item.homeworkStatus}}
                td {{item.homeworkStatus}}
                td {{item.homeworkStatus}}
                td {{item.startTime || "-"}}
                td 
                  span.btn-right 取消关注
                  span.btn-right(@click="openPersonFile(item)") 查看学业档案
                  span 导出学业档案  
</template>
<style lang="scss">
.homework__main {
  .side__menu__title {
    .add {
      right: 50px;
    }
  }
  .side__menu__list {
    a {
     color: $teacherMainColor;
    }    
  }

  .track-content {
    margin-left: -10px;
    /*border: 1px solid gray;*/
    background-color: #FAFAFA;
    border-radius: 10px;
    .track-head {
      .track-select-student-name {
        padding: 10px;
        margin-left: 34px;
        .student-name {
          display: inline-block;
          width: 36px;
          font-size: 12px;
          color: #818385;
          margin-right: 48px;
          margin-bottom: 24px;
        }
      }
      .track-select {
        margin-bottom: 20px;
        margin-top: 16px;
        .class-select {
            border: 1px solid #2186F4;
            border-radius: 6px;
            background: #FAFAFA;
            color: #157FF3;
            font-size: 12px;
            padding: 6px 20px;
            display: inline-block;
            margin-left: 28px;
          }
          .submit-select {
            display: inline-block;
            float: right;
            font-size: 12px;    
            .select {
              display: inline-block;
              .select-border {
                width: 18px;
                height: 18px;
                border-radius: 4px;
                border: 1px solid #157EF2;
                display: inline-block;
                vertical-align: middle;
                cursor: pointer;
                margin-right: 8px;
                margin-left: 8px;
              }
            }
            .totol-count {
              display: inline-block;
              margin-left: 26px;
              margin-right: 38px;     

            }
            .every-anlysis {
              border: 1px solid #2186F4;
              border-radius: 6px;
              background: #FAFAFA;
              color: #157FF3;
              font-size: 12px;
              padding: 5px 20px;
              display: inline-block;
              margin-right: 26px;
            }        
          }
      }     
    
    }
  .track-body {
    .track-table {
      margin-left: 12px;
      span {
        color: $teacherMainColor;
        cursor: pointer;
      }
      .btn-right {
        padding-right: 20px;
      }
    }
  }



  }
}

</style>
<script>
import api from 'api/tutorship'
export default {
  data () {
    return {
      list: [],
      studentNameList: [{
        name: '车子昂',
        id: 1
      }, {
        name: '车子昂',
        id: 2
      }, {
        name: '车子昂',
        id: 3
      }, {
        name: '车子昂',
        id: 4
      }, {
        name: '车子昂',
        id: 5
      }, {
        name: '车子昂',
        id: 6
      }, {
        name: '车子昂',
        id: 7
      }, {
        name: '车子昂',
        id: 8
      }, {
        name: '车子昂',
        id: 9
      }, {
        name: '车子昂',
        id: 10
      }, {
        name: '车子昂',
        id: 11
      }, {
        name: '车子昂',
        id: 12
      }]
    }
  },
  mounted () {
    api.getList('2', {
      studentid: '120176400199057431',
      from: 0,
      size: 10
    }).then((Response) => {
      const data = Response.data
      this.list = data.data.list
    })
  },
  methods: {
    submit () {
      this.$router.push('/teacher/homework/score')
    },
    openPersonFile (item) {
      console.log('to openfile...')
      this.$router.push('/teacher/homework/personReport/' + item.homeworkId)
    }
  }
}
</script>

